<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var nums = [0.25,0.15,0.15,0.15,0.3]
    var start = 0
    var total = 2
    for (var i=0;i<5;i=i+1) {  // nums 顺序

      // 开始
      console.log(start)
      // 结束
      console.log(start + total*nums[i])

      // 下一次的开始 是 当前次的结束
      start = start + total*nums[i]

    }

    // 数据1： 0， 2*0.25  total*nums[i]
    // 数据2： 2*0.25   2*0.25+2*0.15
    // 数据3： 2*0.25+2*0.15   2*0.25+2*0.15+2*0.15
    // 数据4： 2*0.25+2*0.15+2*0.15   2*0.25+2*0.15+2*0.15+2*0.15
    // 数据5： 2*0.25+2*0.15+2*0.15+2*0.15   2


    /*第一次循环   start  total*nums[0]*/
    /*第二次循环   total*nums[0]    total*nums[0]+ total*nums[1]   */
    /*第二次循环   total*nums[0]+ total*nums[1]]    total*nums[0]+ total*nums[1]+total*nums[2]   */
  </script>
</body>
</html>